<template>
  <view :style="{height : pageHeight + 'px'}" class="content">
    <view class="gatherTitle">
      {{ gatherData.messageAssemble.headline }}
    </view>
    <view class="groupList">
      <view v-for="(item,index) in groupList" :key="idnex" class="groupItem">
        <view class="itemTitle">
          <view class="groupNum">
            {{ item.party.groupName }}
          </view>
          <view class="leader">
            组长：{{ item.party.name }}
            <image mode="aspectFit" src="https://echengtuhua.oss-cn-shenzhen.aliyuncs.com/phoneColor.png">
            </image>
            {{ item.party.tel }}
          </view>
        </view>
        <view class="memberList">
          <view v-for="(ite,index) in item.messageAssembleCalls" :key="index" class="memberItem">
            <view :class="[ite.roleId === 2 ? 'leaderBg':'memberBg']">
              <view class="memberInfo">
                <view :class="[ite.roleId === 2? 'leaderTag':'memberTag']">
                  <text v-if="ite.roleId === 2">组长</text>
                  <text v-else>组员</text>
                </view>
                <view class="memberName">
                  <image mode="aspectFit"
                         src="https://echengtuhua.oss-cn-shenzhen.aliyuncs.com/passengerIcon.png"></image>
                  {{ ite.name }}
                </view>
                <view class="phone">
                  <image mode="aspectFit"
                         src="https://echengtuhua.oss-cn-shenzhen.aliyuncs.com/phoneIcon.png"></image>
                  {{ ite.phone }}
                </view>

                <view class="signStatus">
                  <text v-if="ite.status===1" style="color: #4186F5;">已签到</text>
                  <text v-else style="color: #FF0000;">未签到</text>
                </view>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
  </view>
</template>

<script>
import {
  selectSignInfo
} from '@/api/tourplan.js'

export default {
  data() {
    return {
      pageHeight: 750,
      gatherData: [],
      groupList: [],
      groupId: null,
      proposalId: 0,
      itineraryId: 0,
    }
  },
  onLoad: function (options) {
    const that = this
    uni.getSystemInfo({
      success: function (res) {
        that.pageHeight = res.windowHeight
      }
    });
    that.initData(options)
  },
  methods: {
    initData(options) {
      const that = this
      const dataJSON = decodeURIComponent(options.gatherData)
      that.gatherData = JSON.parse(dataJSON)
      that.groupId = options.groupId
      that.itineraryId = options.itineraryId
      that.getSignInfo(that.gatherData.messageAssemble.id, that.itineraryId)
    },
    //查询集合签到详情
    getSignInfo(messageId, journeyId) {
      const that = this
      selectSignInfo({
        messageAssembleId: messageId,
        journeyId: that.itineraryId

      }).then(res => {
        that.groupList = res
      })
    }
  }
}
</script>

<style>
@import url('signInfo.css');
</style>
